package test1;

public class Testtest {
    public static void main(String[] args) {
        Test[]arr=new Test[3];

        Test t1 = new Test("OPPO FindX8Ultra",6999,"月光白");
        Test t2 = new Test("OPPO FindN5",9999,"缎黑");
        Test t3 = new Test("iPhone16 ProMax",10999,"沙漠色钛金属");

        arr[0]=t1;
        arr[1]=t2;
        arr[2]=t3;

        int sum =0;
        for (int i = 0; i < arr.length; i++) {
            Test test=arr[i];
            sum=sum+test.getPrice();
        }

        //int avg=sum/ arr.length;
        double avg2 =sum*1.0/ arr.length;
        System.out.println(avg2);
    }
}
